import java.util.Random;
import java.util.Scanner;

public class damo2 {
    //练习2
    //键盘输入任意字符串,打乱其内容
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String next = sc.next();
        for (int i = 0; i < 100; i++) {
            String random = random(next);
            System.out.println(random);
        }



    }

    //打内容的方法,也就是先把字符串变为字符数组,再随机打乱数组的内容
    public static String random(String next) {
        char[] charArray = next.toCharArray();
        Random r = new Random();
        int number = r.nextInt(charArray.length);
        char count = ' ';
        for (int i = 0; i < charArray.length; i++) {
            count = charArray[i];
            charArray[i] = charArray[number];
            charArray[number] = count;
        }
        String newString = "";
        for (int i = 0; i < charArray.length; i++) {
            newString = charArray[i] + newString;

        }
        return newString;

    }


}
